//
//  SalaryModel.m
//  FindJob
//
//  Created by 233 on 16/3/3.
//  Copyright © 2016年 Lee. All rights reserved.
//

#import "SalaryModel.h"

@implementation SalaryModel
- (NSArray *)gainSalaryModels{
    NSArray *titles = @[@"地      区",@"行      业",@"职      能",@"工作经验"];
    NSMutableArray *resultArr = [[NSMutableArray alloc] init];
    for (int i = 0 ; i < titles.count; i++) {
        
        NSArray *values;

        switch (i) {
            case 0:
            {
              values = [self gainCitydatas];
            }
                break;
            case 1:
            {
                values = [self gainIndustrydata];
            }
                break;
            case 2:
            {
                values = [NSArray array];
            }
                break;
            case 3:
            {
                values = [self gainWorkExperenceData];
            }
                break;
            default:
                break;
        }
        
//        NSDictionary *dict = [NSDictionary alloc] initWithObjects:<#(nonnull NSArray *)#> forKeys:<#(nonnull NSArray<id<NSCopying>> *)#>
        
        NSDictionary *dict =@{titles[i]:values};
        [resultArr addObject:dict];
        
    }
    return resultArr;
}
#pragma mark -- private

- (NSArray *)gainCitydatas{
    
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"ProvincesAndCities" ofType:@"plist"];
    NSArray *citys = [[NSArray alloc] initWithContentsOfFile:filePath];
    return citys;
}
- (NSArray *)gainIndustrydata{
     NSString *filePath = [[NSBundle mainBundle] pathForResource:@"LocalOptions" ofType:@"plist"];
    NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:filePath];
    NSArray *industryArr = dict[@"industry"];
    return industryArr;
}
- (NSArray *)gainWorkExperenceData{
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"LocalOptions" ofType:@"plist"];
    NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:filePath];
    NSArray *workExperenceArr = dict[@"yearsOfWorking"];
    return workExperenceArr;
}
@end
